package com.dexin.rabbitmq.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("receiveService")
public class ReceiveService {

    @Autowired
    private AmqpTemplate template;

    public void receive(){
        //接收消息并转换
        //参数1 我们自定义的消息队列名称
        Object myQueue = template.receiveAndConvert("myQueue");

    }
}
